package com.puzzlebazar.client.admin;

import com.google.gwt.user.client.rpc.IsSerializable;

public class SiteInfo implements IsSerializable {

	public static final int MIN_SITE_NAME_LENGTH = 1;
	public static final int MIN_SITE_DESCRIPTION_LENGTH = 1;

	public static final int MAX_SITE_NAME_LENGTH = 30;
	public static final int MAX_SITE_DESCRIPTION_LENGTH = 100;
	
	private String siteName = "";
	private String siteDescription = "";
	private String welcomeMessage = "";

	private String loginURL = "";
	private String logoutURL = "";
	
	/**
	 * @param siteName The name of this website (standard string)
	 */
	public void setSiteName(String siteName) {
		this.siteName = siteName;
	}
	
	/**
	 * @return The name of this website (standard string)
	 */
	public String getSiteName() {
		return siteName;
	}
	
	/**
	 * @param siteDescription A description of this website (HTML string)
	 */
	public void setSiteDescription(String siteDescription) {
		this.siteDescription = siteDescription;
	}
	
	/**
	 * @return A description of this website (HTML string)
	 */
	public String getSiteDescription() {
		return siteDescription;
	}
	
	/**
	 * @param welcomeMessage The welcome message to display
	 */
	public void setWelcomeMessage(String welcomeMessage) {
		this.welcomeMessage = welcomeMessage;
	}
	
	/**
	 * @return The welcome message to display
	 */
	public String getWelcomeMessage() {
		return welcomeMessage;
	}

	/**
	 * @param loginURL The URL to use for Google Accounts login
	 */
	public void setLoginURL(String loginURL) {
		this.loginURL = loginURL;
	}

	/**
	 * @return The URL to use for Google Accounts login
	 */
	public String getLoginURL() {
		return loginURL;
	}

	/**
	 * @param logoutURL The URL to use for Google Accounts logout
	 */
	public void setLogoutURL(String logoutURL) {
		this.logoutURL = logoutURL;
	}

	/**
	 * @return The URL to use for Google Accounts logout
	 */
	public String getLogoutURL() {
		return logoutURL;
	}

	/**
	 * @return True if the information is valid, false if not
	 */
	public boolean isValid() {
		return  siteName != null && siteName.length()>0 && 
				siteDescription != null && siteDescription.length()>0 &&
				welcomeMessage != null && welcomeMessage.length()>0;
	}
}
